var user = {
	loginSetting : 'login',
	passwordSetting : 'password',
	tokenSetting : 'token',
	
	getLogin : function (){ return Ti.App.Properties.getString(this.loginSetting,''); },
	getPassword : function (){ return Ti.App.Properties.getString(this.passwordSetting,''); },
	getToken : function (){ return Ti.App.Properties.getString(this.tokenSetting,''); },
	
	setLogin : function (login){ return Ti.App.Properties.setString(this.loginSetting,login); },
	setPassword : function (password){ return Ti.App.Properties.setString(this.passwordSetting,password); },
	setToken : function (token){ return Ti.App.Properties.setString(this.tokenSetting,token); },

	save : function (login,password) {
		this.setLogin(login);
		this.setPassword(password);
	},
	
	clear : function () {
		this.setLogin('');
		this.setPassword('');
		this.setToken('');
	},
	
	isDefined : function (){ 
		return this.getLogin() != "" && this.getPassword() != "";
	},
	
	hasToken : function (){ 
		return this.getToken() != "";
	}
	
};